{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Statistical analysis for \"Limits on Regret as a Tool for Incentive Design\"\n",
    "\n",
    "#### Laboratory data\n",
    "\n",
    "#### Written for STATA 18"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "sca drop _all\n",
    "\n",
    "set more off\n",
    "\n",
    "clear all\n",
    "\n",
    "set scheme lean2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "* Define folder locations if working with local computer\n",
    "\n",
    "local folderloc=\"/Users/`c(username)'/Dropbox/isw_dynregret/paper/JPEMicro/publication/\"\n",
    "qui cd `folderloc'\n",
    "local data = \"`folderloc'/stata/data/\"\n",
    "local i = \"`folderloc'/stata/i/\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (1) Open dataset with lab data\n",
    "Simplified dataset with reduced number of variables"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "use \"`data'/202410_data_lab.dta\", clear"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "session       Risk7         Risk20        Match3        IsFemale\n",
      "t             Risk8         V             Match         TT\n",
      "Subject       Risk9         id            OfferC        TR\n",
      "Profit        Risk10        X             Riskearnings  EV\n",
      "TotalProfit   Risk11        Playnumber1   gender        relative_V\n",
      "TotalEarni~s  Risk12        Playnumber2   major         wave\n",
      "Risk0         Risk13        Playnumber3   SessionType   mod_practice\n",
      "Risk1         Risk14        EnterLottery  session_nu~r  i\n",
      "Risk2         Risk15        WinN1         subject_nu~r  monotoneRi~e\n",
      "Risk3         Risk16        WinN2         j             RiskCertai~t\n",
      "Risk4         Risk17        WinN3         jt            RiskViolat~n\n",
      "Risk5         Risk18        Match1        WonPrize\n",
      "Risk6         Risk19        Match2        AcademicMa~r\n"
     ]
    }
   ],
   "source": [
    "ds"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1.1 Data from the first wave of lab experiments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "                  |                     TR\n",
      "               TT |       Std         Re  Re-Choice  Re-Social |     Total\n",
      "------------------+--------------------------------------------+----------\n",
      "    One-shot (30) |        50         50          0          0 |       100 \n",
      "              Seq |        50         50         30         30 |       206 \n",
      "------------------+--------------------------------------------+----------\n",
      "            Total |       100        100         30         30 |       306 \n",
      "\n",
      "\n",
      "                  |     TR\n",
      "               TT |    Re-Rnd |     Total\n",
      "------------------+-----------+----------\n",
      "    One-shot (30) |         0 |       100 \n",
      "              Seq |        46 |       206 \n",
      "------------------+-----------+----------\n",
      "            Total |        46 |       306 \n"
     ]
    }
   ],
   "source": [
    "tab TT TR if t==1 & wave==1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1.2 Data from the second wave of lab experiments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "                  |          TR\n",
      "               TT |       Std         Re |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |        30         30 |        60 \n",
      "              Seq |        60         60 |       120 \n",
      "------------------+----------------------+----------\n",
      "            Total |        90         90 |       180 \n"
     ]
    }
   ],
   "source": [
    "tab TT TR if t==1 & wave==2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (2) Tests of means"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.1 Average valuation in Simultaneous treatments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "     Std |      80    .5847423    .0392362    .3509395    .5066445      .66284\n",
      "      Re |      80    .6451547    .0434358    .3885019    .5586978    .7316115\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     160    .6149485    .0292727    .3702733     .557135    .6727619\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |           -.0604124    .0585334               -.1760211    .0551964\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(Std) - mean(Re)                                   t =  -1.0321\n",
      "H0: diff = 0                                     Degrees of freedom =      158\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.1518         Pr(|T| > |t|) = 0.3036          Pr(T > t) = 0.8482\n"
     ]
    }
   ],
   "source": [
    "ttest relative_V if t==1 & TT==1, by(TR)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "          TR |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "         Std |       80        6256        6440\n",
      "          Re |       80        6624        6440\n",
      "-------------+---------------------------------\n",
      "    Combined |      160       12880       12880\n",
      "\n",
      "Unadjusted variance    85866.67\n",
      "Adjustment for ties      -53.71\n",
      "                     ----------\n",
      "Adjusted variance      85812.96\n",
      "\n",
      "H0: relati~V(TR==Std) = relati~V(TR==Re)\n",
      "         z = -0.628\n",
      "Prob > |z| = 0.5299\n",
      "Exact prob = 0.5315\n"
     ]
    }
   ],
   "source": [
    "ranksum relative_V if t==1 & TT==1, by(TR)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.2 Average first-round valuations for Standard lotteries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: does not include sessions with modified practice stage ('mod_practice' variable)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "One-shot |      80    .5847423    .0392362    .3509395    .5066445      .66284\n",
      "     Seq |      80    .9231959    .0372744    .3333923    .8490031    .9973887\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     160    .7539691    .0301284    .3810977    .6944656    .8134726\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |           -.3384536     .054119               -.4453435   -.2315637\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(One-shot) - mean(Seq)                             t =  -6.2539\n",
      "H0: diff = 0                                     Degrees of freedom =      158\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000\n"
     ]
    }
   ],
   "source": [
    "ttest relative_V if t==1 & TR==0 & mod_practice==0, by(TT)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "          TT |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "One-shot (30 |       80        4859        6440\n",
      "         Seq |       80        8021        6440\n",
      "-------------+---------------------------------\n",
      "    Combined |      160       12880       12880\n",
      "\n",
      "Unadjusted variance    85866.67\n",
      "Adjustment for ties      -75.60\n",
      "                     ----------\n",
      "Adjusted variance      85791.07\n",
      "\n",
      "H0: relati~V(TT==One-shot (30)) = relati~V(TT==Seq)\n",
      "         z = -5.398\n",
      "Prob > |z| = 0.0000\n",
      "Exact prob = 0.0000\n"
     ]
    }
   ],
   "source": [
    "ranksum relative_V if t==1 & TR==0 & mod_practice==0, by(TT)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.3 Average first-round valuations for Regret lotteries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: does not include sessions with modified practice stage ('mod_practice' variable)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "One-shot |      80    .6451547    .0434358    .3885019    .5586978    .7316115\n",
      "     Seq |      80    .8135052      .03779    .3380036    .7382862    .8887242\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     160    .7293299    .0294625    .3726744    .6711416    .7875182\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |           -.1683505    .0575739               -.2820642   -.0546368\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(One-shot) - mean(Seq)                             t =  -2.9241\n",
      "H0: diff = 0                                     Degrees of freedom =      158\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.0020         Pr(|T| > |t|) = 0.0040          Pr(T > t) = 0.9980\n"
     ]
    }
   ],
   "source": [
    "ttest relative_V if t==1 & TR==1 & mod_practice==0, by(TT)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "          TT |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "One-shot (30 |       80      5555.5        6440\n",
      "         Seq |       80      7324.5        6440\n",
      "-------------+---------------------------------\n",
      "    Combined |      160       12880       12880\n",
      "\n",
      "Unadjusted variance    85866.67\n",
      "Adjustment for ties     -104.53\n",
      "                     ----------\n",
      "Adjusted variance      85762.14\n",
      "\n",
      "H0: relati~V(TT==One-shot (30)) = relati~V(TT==Seq)\n",
      "         z = -3.020\n",
      "Prob > |z| = 0.0025\n",
      "Exact prob = 0.0024\n"
     ]
    }
   ],
   "source": [
    "ranksum relative_V if t==1 & TR==1 & mod_practice==0, by(TT)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.4 Average first-round valuations for Sequential treatments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "     Std |      80    .9231959    .0372744    .3333923    .8490031    .9973887\n",
      "      Re |      80    .8135052      .03779    .3380036    .7382862    .8887242\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     160    .8683505    .0268114    .3391409     .815398     .921303\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .1096907    .0530798                .0048533    .2145281\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(Std) - mean(Re)                                   t =   2.0665\n",
      "H0: diff = 0                                     Degrees of freedom =      158\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.9798         Pr(|T| > |t|) = 0.0404          Pr(T > t) = 0.0202\n"
     ]
    }
   ],
   "source": [
    "ttest relative_V if t==1 & TT==2 & TR<=1 & mod_practice==0, by(TR)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (3) TABLE 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: results from these regressions are used in the TikZ code to generate Figure 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "order session i t TT TR wave V X Risk*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.1 Hypothesis 1: static regret effect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(1, 158)         =       1.07\n",
      "                                                Prob > F          =     0.3036\n",
      "                                                R-squared         =     0.0067\n",
      "                                                Root MSE          =      .3702\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0604124   .0585334     1.03   0.304    -.0551964    .1760211\n",
      "       _cons |   .5847423   .0392362    14.90   0.000     .5072471    .6622374\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .6451547   .0434358    14.85   0.000     .5593649    .7309444\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(2, 157)         =       5.40\n",
      "                                                Prob > F          =     0.0054\n",
      "                                                R-squared         =     0.0702\n",
      "                                                Root MSE          =     .35931\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0675183   .0569329     1.19   0.237    -.0449349    .1799714\n",
      "      female |  -.1894901   .0602939    -3.14   0.002    -.3085819   -.0703983\n",
      "       _cons |   .6936991    .054641    12.70   0.000     .5857729    .8016253\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(1, 159)         =       1.07\n",
      "                                                Prob > F          =     0.3021\n",
      "                                                R-squared         =     0.0067\n",
      "                                                Root MSE          =     .36795\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0604124   .0583551     1.04   0.302    -.0548387    .1756634\n",
      "       _cons |   .5847423   .0391167    14.95   0.000     .5074869    .6619977\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .6451547   .0433035    14.90   0.000     .5596303     .730679\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(2, 159)         =       5.46\n",
      "                                                Prob > F          =     0.0051\n",
      "                                                R-squared         =     0.0702\n",
      "                                                Root MSE          =     .35604\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0675183   .0565854     1.19   0.235    -.0442378    .1792743\n",
      "      female |  -.1894901    .059926    -3.16   0.002    -.3078436   -.0711366\n",
      "       _cons |   .6936991   .0543075    12.77   0.000     .5864419    .8009562\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT == 1\n",
    "qui gen regret = TR == 1\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1, r\n",
    "lincom _cons + _b[regret]\n",
    "\n",
    "reg relative_V regret female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret, cluster(i)\n",
    "lincom _cons + _b[regret]\n",
    "\n",
    "reg relative_V regret female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.2 Hypothesis 2: Sequentiality Effect on Standard Lotteries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: does not include sessions with modified practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(1, 158)         =      39.11\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.1984\n",
      "                                                Root MSE          =     .34228\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .3384536    .054119     6.25   0.000     .2315637    .4453435\n",
      "       _cons |   .5847423   .0392362    14.90   0.000     .5072471    .6622374\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .9231959   .0372744    24.77   0.000     .8495755    .9968162\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(2, 157)         =      23.87\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.2206\n",
      "                                                Root MSE          =     .33858\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .3457065   .0532672     6.49   0.000     .2404938    .4509193\n",
      "      female |  -.1160466   .0557463    -2.08   0.039    -.2261561   -.0059372\n",
      "       _cons |   .6514691   .0532993    12.22   0.000      .546193    .7567452\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(1, 159)         =      33.17\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.1458\n",
      "                                                Root MSE          =     .35802\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |    .295756   .0513536     5.76   0.000     .1943328    .3971792\n",
      "       _cons |   .5847423   .0391167    14.95   0.000     .5074869    .6619977\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8804983   .0332727    26.46   0.000     .8147848    .9462118\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(2, 159)         =      28.80\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.1920\n",
      "                                                Root MSE          =     .34823\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .3064321   .0490737     6.24   0.000     .2095118    .4033524\n",
      "      female |  -.1708167   .0507282    -3.37   0.001    -.2710048   -.0706286\n",
      "       _cons |   .6829619   .0511797    13.34   0.000     .5818822    .7840416\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 0 & mod_practice == 0\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.3 Hypothesis 3: Sequentiality Effect on Regret Lotteries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: does not include sessions with modified practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(1, 158)         =       8.55\n",
      "                                                Prob > F          =     0.0040\n",
      "                                                R-squared         =     0.0513\n",
      "                                                Root MSE          =     .36413\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1683505   .0575739     2.92   0.004     .0546368    .2820642\n",
      "       _cons |   .6451547   .0434358    14.85   0.000     .5593649    .7309444\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8135052     .03779    21.53   0.000     .7388665    .8881438\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(2, 157)         =       6.68\n",
      "                                                Prob > F          =     0.0016\n",
      "                                                R-squared         =     0.0789\n",
      "                                                Root MSE          =     .35994\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |    .160522   .0571091     2.81   0.006     .0477207    .2733233\n",
      "      female |  -.1252556   .0600083    -2.09   0.038    -.2437834   -.0067278\n",
      "       _cons |   .7218737   .0606044    11.91   0.000     .6021686    .8415788\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(1, 159)         =      12.67\n",
      "                                                Prob > F          =     0.0005\n",
      "                                                R-squared         =     0.0582\n",
      "                                                Root MSE          =      .3827\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1902577   .0534538     3.56   0.000     .0846866    .2958289\n",
      "       _cons |   .6451547   .0433035    14.90   0.000     .5596303     .730679\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8354124   .0313388    26.66   0.000     .7735185    .8973063\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(2, 159)         =      11.48\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.0913\n",
      "                                                Root MSE          =     .37596\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1811578   .0527527     3.43   0.001     .0769713    .2853443\n",
      "      female |   -.145599   .0548012    -2.66   0.009    -.2538312   -.0373669\n",
      "       _cons |   .7343341   .0584015    12.57   0.000     .6189913    .8496768\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 1 & mod_practice==0\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.4 Hypothesis 4: Anticipated Learning Hypothesis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: does not include sessions with modified practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(1, 158)         =       4.27\n",
      "                                                Prob > F          =     0.0404\n",
      "                                                R-squared         =     0.0263\n",
      "                                                Root MSE          =     .33571\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.1096907   .0530798    -2.07   0.040    -.2145281   -.0048533\n",
      "       _cons |   .9231959   .0372744    24.77   0.000     .8495755    .9968162\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        160\n",
      "                                                F(2, 157)         =       2.87\n",
      "                                                Prob > F          =     0.0594\n",
      "                                                R-squared         =     0.0319\n",
      "                                                Root MSE          =     .33581\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.1141928   .0526879    -2.17   0.032    -.2182614   -.0101242\n",
      "      female |  -.0514528   .0548491    -0.94   0.350    -.1597903    .0568846\n",
      "       _cons |   .9559971   .0508954    18.78   0.000     .8554689    1.056525\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(1, 159)         =       0.97\n",
      "                                                Prob > F          =     0.3254\n",
      "                                                R-squared         =     0.0036\n",
      "                                                Root MSE          =     .37316\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0450859   .0457077    -0.99   0.325    -.1353584    .0451866\n",
      "       _cons |   .8804983   .0332727    26.46   0.000     .8147848    .9462118\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      4,800\n",
      "                                                F(2, 159)         =       5.09\n",
      "                                                Prob > F          =     0.0072\n",
      "                                                R-squared         =     0.0310\n",
      "                                                Root MSE          =     .36803\n",
      "\n",
      "                                    (Std. err. adjusted for 160 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0561524   .0442512    -1.27   0.206    -.1435483    .0312435\n",
      "      female |  -.1264744    .044404    -2.85   0.005    -.2141721   -.0387767\n",
      "       _cons |   .9611257   .0396816    24.22   0.000     .8827547    1.039497\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret = .06\n",
      "\n",
      "       F(  1,   159) =    6.89\n",
      "            Prob > F =    0.0095\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR <= 1 & mod_practice==0\n",
    "\n",
    "qui gen regret = TR == 1\n",
    "qui gen sequential = TT == 2\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1 & TT==2, r\n",
    "reg relative_V regret female if t==1 & TT==2, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret if TT==2, cluster(i)\n",
    "reg relative_V regret female if TT==2, cluster(i)\n",
    "\n",
    "* One-sample ttest on the equality of the sequential and static regret effects\n",
    "test _b[regret] == 0.06\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (4) FIGURE 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: generates all of the necesssary data to create the TikZ image. Does not include sessions with the modified practice stage. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.1 Average valuation for the simultaneous treatments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "         Means, Standard Deviations and Frequencies of relative_V\n",
      "\n",
      "           |         TR\n",
      "        TT |       Std         Re |     Total\n",
      "-----------+----------------------+----------\n",
      " One-shot  | .58474228  .64515466 | .61494847\n",
      "           |  .3509395  .38850189 | .37027334\n",
      "           |        80         80 |       160\n",
      "-----------+----------------------+----------\n",
      "     Total | .58474228  .64515466 | .61494847\n",
      "           |  .3509395  .38850189 | .37027334\n",
      "           |        80         80 |       160\n"
     ]
    }
   ],
   "source": [
    "tab TT TR if TT==1 & t==1, sum(relative_V)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.2 Aveeage valuations per 5-round block for sequential treatments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .81383507   .37233518         400\n",
      "          2 |   .82065981   .37333713         400\n",
      "          3 |   .82039177   .35569676         400\n",
      "          4 |    .8156495    .3592418         400\n",
      "          5 |   .83255672   .37073348         400\n",
      "          6 |   .90938146   .43226458         400\n",
      "------------+------------------------------------\n",
      "      Total |   .83541239   .37922701       2,400\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .89061858   .34402008         400\n",
      "          2 |   .85882476   .36284385         400\n",
      "          3 |   .88189693   .36530496         400\n",
      "          4 |   .85694847   .36468291         400\n",
      "          5 |   .88354641   .36959486         400\n",
      "          6 |   .91115466   .39327011         400\n",
      "------------+------------------------------------\n",
      "      Total |    .8804983   .36699314       2,400\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if ~mod_practice\n",
    "\n",
    "qui gen block = ( t >= 1 & t<= 5)\n",
    "qui replace block = 2 if ( t > 5 & t <= 10)\n",
    "qui replace block = 3 if ( t > 10 & t <= 15)\n",
    "qui replace block = 4 if ( t > 15 & t <= 20)\n",
    "qui replace block = 5 if ( t > 20 & t <= 25)\n",
    "qui replace block = 6 if ( t > 25 & t <= 30)\n",
    "\n",
    "* For regret-sequential *\n",
    "tab block if TR==1 & TT==2, sum(relative_V)\n",
    "\n",
    "* For standard-sequential *\n",
    "tab block if TR==0 & TT==2, sum(relative_V)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (5) TABLE 3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.1 Standard sequential\n",
    "\n",
    "Define Delta_V and run panel regression on previous loss and previous win indicators."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Random-effects GLS regression                   Number of obs     =      2,320\n",
      "Group variable: i                               Number of groups  =         80\n",
      "\n",
      "R-squared:                                      Obs per group:\n",
      "     Within  = 0.1201                                         min =         29\n",
      "     Between = 0.0241                                         avg =       29.0\n",
      "     Overall = 0.0987                                         max =         29\n",
      "\n",
      "                                                Wald chi2(2)      =     253.63\n",
      "corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "     pre_Win |  -.0448464   .0102282    -4.38   0.000    -.0648932   -.0247995\n",
      "    pre_Loss |  -.0935554    .005875   -15.92   0.000    -.1050703   -.0820406\n",
      "       _cons |   .0446258   .0039716    11.24   0.000     .0368416    .0524099\n",
      "-------------+----------------------------------------------------------------\n",
      "     sigma_u |          0\n",
      "     sigma_e |  .13502765\n",
      "         rho |          0   (fraction of variance due to u_i)\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_Win + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |  -.0002206   .0094256    -0.02   0.981    -.0186945    .0182533\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_Loss + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |  -.0489297   .0043292   -11.30   0.000    -.0574148   -.0404445\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "qui preserve\n",
    "\n",
    "qui keep if TT==2 & TR==0 & ~mod_practice\n",
    "qui sort i t\n",
    "\n",
    "* Create variable equal to change in valuation\n",
    "qui gen delta_V = V - V[_n-1] if t>=2\n",
    "\n",
    "* Define current-period WIN and LOSS\n",
    "qui gen Win = ( EnterLottery==1 & Match>=1 )\n",
    "qui gen Loss = ( EnterLottery==1 & Match==0 )\n",
    "\n",
    "* Define last-period WIN and LOSS\n",
    "qui gen pre_Win = Win[_n-1] if t>=2 \n",
    "qui gen pre_Loss = Loss[_n-1] if t>=2 \n",
    "\n",
    "qui xtset i t\n",
    "xtreg delta_V pre_Win pre_Loss, re\n",
    "\n",
    "* Effect of prior win on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_Win]\n",
    "\n",
    "* Effect of prior loss on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_Loss]\n",
    "\n",
    "qui restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "5.2 Regret Sequential\n",
    "\n",
    "Define Delta_V and run panel regression on previous loss, previous win, previous conterfactual win, and previous counterfactual loss.\n",
    "\n",
    "Column (1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Random-effects GLS regression                   Number of obs     =      2,320\n",
      "Group variable: i                               Number of groups  =         80\n",
      "\n",
      "R-squared:                                      Obs per group:\n",
      "     Within  = 0.0896                                         min =         29\n",
      "     Between = 0.0002                                         avg =       29.0\n",
      "     Overall = 0.0779                                         max =         29\n",
      "\n",
      "                                                Wald chi2(2)      =     195.69\n",
      "corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "     pre_Win |  -.0522223   .0137311    -3.80   0.000    -.0791348   -.0253098\n",
      "    pre_Loss |  -.1059608   .0075781   -13.98   0.000    -.1208137    -.091108\n",
      "       _cons |    .051898   .0050257    10.33   0.000     .0420478    .0617481\n",
      "-------------+----------------------------------------------------------------\n",
      "     sigma_u |          0\n",
      "     sigma_e |  .17537359\n",
      "         rho |          0   (fraction of variance due to u_i)\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_Win + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |  -.0003243   .0127783    -0.03   0.980    -.0253694    .0247208\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_Loss + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |  -.0540628   .0056719    -9.53   0.000    -.0651795   -.0429461\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT==2 & TR==1 & ~mod_practice\n",
    "qui sort i t\n",
    "\n",
    "* Create variable equal to change in valuation\n",
    "qui gen delta_V = V - V[_n-1] if t>=2\n",
    "\n",
    "* Define current-period realized WIN and LOSS\n",
    "qui gen Win = ( EnterLottery==1 & Match>=1 )\n",
    "qui gen Loss = ( EnterLottery==1 & Match==0 )\n",
    "\n",
    "* Define last-period realized WIN and LOSS\n",
    "qui gen pre_Win = Win[_n-1] if t>=2 \n",
    "qui gen pre_Loss = Loss[_n-1] if t>=2 \n",
    "\n",
    "qui xtset i t\n",
    "\n",
    "xtreg delta_V pre_Win pre_Loss, re /* Constant means did not enter last period */\n",
    "\n",
    "* Effect of prior win on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_Win]\n",
    "\n",
    "* Effect of prior loss on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_Loss]\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Column (2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "    Variable |        Obs        Mean    Std. dev.       Min        Max\n",
      "-------------+---------------------------------------------------------\n",
      "     delta_V |        939   -.0540628    .1841263      -.995       .805\n",
      "\n",
      "\n",
      "    Variable |        Obs        Mean    Std. dev.       Min        Max\n",
      "-------------+---------------------------------------------------------\n",
      "     delta_V |        185   -.0003243    .1719791      -.945        .77\n",
      "\n",
      "\n",
      "    Variable |        Obs        Mean    Std. dev.       Min        Max\n",
      "-------------+---------------------------------------------------------\n",
      "     delta_V |        998    .0460972     .165595       -.74       .995\n",
      "\n",
      "\n",
      "    Variable |        Obs        Mean    Std. dev.       Min        Max\n",
      "-------------+---------------------------------------------------------\n",
      "     delta_V |        198    .0811364    .1625755       -.44        .94\n",
      "\n",
      "\n",
      "\n",
      "Random-effects GLS regression                   Number of obs     =      2,320\n",
      "Group variable: i                               Number of groups  =         80\n",
      "\n",
      "R-squared:                                      Obs per group:\n",
      "     Within  = 0.0919                                         min =         29\n",
      "     Between = 0.0011                                         avg =       29.0\n",
      "     Overall = 0.0806                                         max =         29\n",
      "\n",
      "                                                Wald chi2(3)      =     202.90\n",
      "corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      " pre_cf_Loss |     .10016   .0078921    12.69   0.000     .0846919    .1156282\n",
      "  pre_cf_Win |   .1351992    .013575     9.96   0.000     .1085927    .1618057\n",
      "     pre_Win |   .0537385   .0139633     3.85   0.000     .0263709    .0811061\n",
      "       _cons |  -.0540628   .0056649    -9.54   0.000    -.0651658   -.0429599\n",
      "-------------+----------------------------------------------------------------\n",
      "     sigma_u |          0\n",
      "     sigma_e |  .17518326\n",
      "         rho |          0   (fraction of variance due to u_i)\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_Win + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |  -.0003243   .0127626    -0.03   0.980    -.0253385    .0246899\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_cf_Loss + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .0460972   .0054949     8.39   0.000     .0353274     .056867\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  pre_cf_Win + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .0811364   .0123365     6.58   0.000     .0569573    .1053154\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  - pre_cf_Loss + pre_cf_Win = 0\n",
      "\n",
      "           chi2(  1) =    6.73\n",
      "         Prob > chi2 =    0.0095\n",
      "\n",
      "\n",
      " ( 1)  - pre_cf_Loss + pre_cf_Win - pre_Win - _cons = 0\n",
      "\n",
      "           chi2(  1) =    3.62\n",
      "         Prob > chi2 =    0.0570\n",
      "\n",
      "\n",
      " ( 1)  pre_Win = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .0537385   .0139633     3.85   0.000     .0263709    .0811061\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  - pre_cf_Loss + pre_cf_Win + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "     delta_V | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |  -.0190237   .0146449    -1.30   0.194    -.0477272    .0096798\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT==2 & TR==1 & ~mod_practice\n",
    "qui sort i t\n",
    "\n",
    "* Create variable equal to change in valuation\n",
    "qui gen delta_V = V - V[_n-1] if t>=2\n",
    "\n",
    "* Define current-period realized WIN and LOSS\n",
    "qui gen Win = ( EnterLottery==1 & Match>=1 )\n",
    "qui gen Loss = ( EnterLottery==1 & Match==0 )\n",
    "\n",
    "* Define last-period realized WIN and LOSS\n",
    "qui gen pre_Win = Win[_n-1] if t>=2 \n",
    "qui gen pre_Loss = Loss[_n-1] if t>=2 \n",
    "\n",
    "* Define current-period counterfactual WIN and LOSS\n",
    "qui gen cf_Win = ( EnterLottery==0 & Match>=1 )\n",
    "qui gen cf_Loss = ( EnterLottery==0 & Match==0 )\n",
    "\n",
    "* Define last-period counterfactual WIN and LOSS\n",
    "qui gen pre_cf_Win = cf_Win[_n-1] if t>=2 \n",
    "qui gen pre_cf_Loss = cf_Loss[_n-1] if t>=2 \n",
    "\n",
    "sum delta_V if pre_Loss == 1\n",
    "sum delta_V if pre_Win == 1\n",
    "sum delta_V if pre_cf_Loss == 1\n",
    "sum delta_V if pre_cf_Win == 1\n",
    "\n",
    "qui xtset i t\n",
    "\n",
    "xtreg delta_V pre_cf_Loss pre_cf_Win pre_Win, re /* Constant mean entered and lost */\n",
    "\n",
    "* Effect of prior win on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_Win]\n",
    "\n",
    "* Effect of counterfactual loss on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_cf_Loss]\n",
    "\n",
    "* Effect of counterfactual win on valuation *\n",
    "\n",
    "lincom _cons + _b[pre_cf_Win]\n",
    "\n",
    "* Test of equality for conterfactual coefficients\n",
    "\n",
    "test _b[pre_cf_Win] == _b[pre_cf_Loss]\n",
    "\n",
    "test _b[pre_cf_Win] - _b[pre_cf_Loss] == _b[pre_Win] + _cons\n",
    "\n",
    "lincom _b[pre_Win]\n",
    "\n",
    "lincom _b[pre_cf_Win] - _b[pre_cf_Loss] +_cons\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (6) FIGURE 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "         TR |      Freq.     Percent        Cum.\n",
      "------------+-----------------------------------\n",
      "        Std |      3,300       33.74       33.74\n",
      "         Re |      3,300       33.74       67.48\n",
      "  Re-Choice |        900        9.20       76.69\n",
      "  Re-Social |        900        9.20       85.89\n",
      "     Re-Rnd |      1,380       14.11      100.00\n",
      "------------+-----------------------------------\n",
      "      Total |      9,780      100.00\n"
     ]
    }
   ],
   "source": [
    "tab TR if TT==2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.1 Average valuation per 5-round blocks for robustness treatments"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: the data is used to create the TikZ image. Does not include sessions with modified practice."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .81383507   .37233518         400\n",
      "          2 |   .82065981   .37333713         400\n",
      "          3 |   .82039177   .35569676         400\n",
      "          4 |    .8156495    .3592418         400\n",
      "          5 |   .83255672   .37073348         400\n",
      "          6 |   .90938146   .43226458         400\n",
      "------------+------------------------------------\n",
      "      Total |   .83541239   .37922701       2,400\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .89061858   .34402008         400\n",
      "          2 |   .85882476   .36284385         400\n",
      "          3 |   .88189693   .36530496         400\n",
      "          4 |   .85694847   .36468291         400\n",
      "          5 |   .88354641   .36959486         400\n",
      "          6 |   .91115466   .39327011         400\n",
      "------------+------------------------------------\n",
      "      Total |    .8804983   .36699314       2,400\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .75705843   .43667957         150\n",
      "          2 |   .76475603   .43176313         150\n",
      "          3 |   .80346394    .4143472         150\n",
      "          4 |   .79609624   .43212543         150\n",
      "          5 |   .78498971   .43804043         150\n",
      "          6 |   .88989693    .4974463         150\n",
      "------------+------------------------------------\n",
      "      Total |   .79937688   .44342472         900\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .75024057    .3302322         150\n",
      "          2 |   .71169761   .27573446         150\n",
      "          3 |   .67914778    .2716537         150\n",
      "          4 |   .66177321   .26609267         150\n",
      "          5 |   .66056359   .29468071         150\n",
      "          6 |   .70504469   .36666325         150\n",
      "------------+------------------------------------\n",
      "      Total |   .69474457   .30383023         900\n",
      "\n",
      "\n",
      "            |        Summary of relative_V\n",
      "      block |        Mean   Std. dev.       Freq.\n",
      "------------+------------------------------------\n",
      "          1 |   .90402512   .40793493         230\n",
      "          2 |   .89057824   .42355762         230\n",
      "          3 |   .91037205   .41717932         230\n",
      "          4 |    .9123084   .41383375         230\n",
      "          5 |   .92485883   .41579047         230\n",
      "          6 |   .95584045   .42833495         230\n",
      "------------+------------------------------------\n",
      "      Total |   .91633052   .41756545       1,380\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui drop if mod_practice==1\n",
    "\n",
    "qui gen block = ( t >= 1 & t<= 5)\n",
    "qui replace block = 2 if ( t > 5 & t <= 10)\n",
    "qui replace block = 3 if ( t > 10 & t <= 15)\n",
    "qui replace block = 4 if ( t > 15 & t <= 20)\n",
    "qui replace block = 5 if ( t > 20 & t <= 25)\n",
    "qui replace block = 6 if ( t > 25 & t <= 30)\n",
    "\n",
    "* For regret-sequential *\n",
    "tab block if TR==1 & TT==2, sum(relative_V)\n",
    "\n",
    "* For standard-sequential *\n",
    "tab block if TR==0 & TT==2, sum(relative_V)\n",
    "\n",
    "* For regret-choice-sequential *\n",
    "tab block if TR==2 & TT==2, sum(relative_V)\n",
    "\n",
    "* For regret-social-sequential *\n",
    "tab block if TR==3 & TT==2, sum(relative_V)\n",
    "\n",
    "* For regret-random-sequential *\n",
    "tab block if TR==4 & TT==2, sum(relative_V)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.2 Tests for first-round valuation differences"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.2.1 Regret versus Choice-Regret"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "         TR |      Freq.     Percent        Cum.\n",
      "------------+-----------------------------------\n",
      "         Re |      2,400       72.73       72.73\n",
      "  Re-Choice |        900       27.27      100.00\n",
      "------------+-----------------------------------\n",
      "      Total |      3,300      100.00\n"
     ]
    }
   ],
   "source": [
    "tab TR if TT==2 & ( TR==1 | TR==2 ) & ~mod_practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "       0 |      80    .8135052      .03779    .3380036    .7382862    .8887242\n",
      "       1 |      30    .7752577    .0704394    .3858124     .631193    .9193224\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     110    .8030741    .0333981    .3502826      .73688    .8692681\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .0382474    .0752475               -.1109061    .1874009\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(0) - mean(1)                                      t =   0.5083\n",
      "H0: diff = 0                                     Degrees of freedom =      108\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.6939         Pr(|T| > |t|) = 0.6123          Pr(T > t) = 0.3061\n",
      "\n",
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "      choice |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "           0 |       80        4481        4440\n",
      "           1 |       30        1624        1665\n",
      "-------------+---------------------------------\n",
      "    Combined |      110        6105        6105\n",
      "\n",
      "Unadjusted variance    22200.00\n",
      "Adjustment for ties      -43.14\n",
      "                     ----------\n",
      "Adjusted variance      22156.86\n",
      "\n",
      "H0: relati~V(choice==0) = relati~V(choice==1)\n",
      "         z =  0.275\n",
      "Prob > |z| = 0.7830\n",
      "Exact prob = 0.7854\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT == 2 & ( TR==1 | TR==2 ) & ~mod_practice\n",
    "\n",
    "qui gen choice = TR == 2\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* T-test *\n",
    "ttest relative_V if t==1, by(choice)\n",
    "\n",
    "* Mann-Whitney *\n",
    "ranksum relative_V if t==1, by(choice)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.2.2 Regret versus Social-Regret"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "         TR |      Freq.     Percent        Cum.\n",
      "------------+-----------------------------------\n",
      "         Re |      2,400       72.73       72.73\n",
      "  Re-Social |        900       27.27      100.00\n",
      "------------+-----------------------------------\n",
      "      Total |      3,300      100.00\n"
     ]
    }
   ],
   "source": [
    "tab TR if TT==2 & ( TR==1 | TR==3 ) & ~mod_practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "       0 |      80    .8135052      .03779    .3380036    .7382862    .8887242\n",
      "       1 |      30    .7697595    .0561465    .3075269     .654927    .8845919\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     110    .8015745    .0313843    .3291612    .7393719    .8637772\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .0437457    .0706694               -.0963334    .1838248\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(0) - mean(1)                                      t =   0.6190\n",
      "H0: diff = 0                                     Degrees of freedom =      108\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.7314         Pr(|T| > |t|) = 0.5372          Pr(T > t) = 0.2686\n",
      "\n",
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "      social |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "           0 |       80      4458.5        4440\n",
      "           1 |       30      1646.5        1665\n",
      "-------------+---------------------------------\n",
      "    Combined |      110        6105        6105\n",
      "\n",
      "Unadjusted variance    22200.00\n",
      "Adjustment for ties      -75.56\n",
      "                     ----------\n",
      "Adjusted variance      22124.44\n",
      "\n",
      "H0: relati~V(social==0) = relati~V(social==1)\n",
      "         z =  0.124\n",
      "Prob > |z| = 0.9010\n",
      "Exact prob = 0.9029\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT == 2 & ( TR==1 | TR==3 ) & ~mod_practice\n",
    "\n",
    "qui gen social = TR == 3\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* T-test *\n",
    "ttest relative_V if t==1, by(social)\n",
    "\n",
    "* Mann-Whitney *\n",
    "ranksum relative_V if t==1, by(social)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.2.3 Standard versus Regret-Choice (first-round only)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "           |     TT\n",
      "        TR |       Seq |     Total\n",
      "-----------+-----------+----------\n",
      "       Std |     2,400 |     2,400 \n",
      " Re-Choice |       900 |       900 \n",
      "-----------+-----------+----------\n",
      "     Total |     3,300 |     3,300 \n"
     ]
    }
   ],
   "source": [
    "tab TR TT if TT==2 & ( TR==0 | TR==2 ) & ~mod_practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "       0 |      80    .9231959    .0372744    .3333923    .8490031    .9973887\n",
      "       1 |      30    .7752577    .0704394    .3858124     .631193    .9193224\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     110    .8828491    .0336482     .352905    .8161595    .9495387\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .1479381    .0745545                .0001581    .2957182\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(0) - mean(1)                                      t =   1.9843\n",
      "H0: diff = 0                                     Degrees of freedom =      108\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.9751         Pr(|T| > |t|) = 0.0498          Pr(T > t) = 0.0249\n",
      "\n",
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "      regret |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "           0 |       80      4722.5        4440\n",
      "           1 |       30      1382.5        1665\n",
      "-------------+---------------------------------\n",
      "    Combined |      110        6105        6105\n",
      "\n",
      "Unadjusted variance    22200.00\n",
      "Adjustment for ties      -41.03\n",
      "                     ----------\n",
      "Adjusted variance      22158.97\n",
      "\n",
      "H0: relati~V(regret==0) = relati~V(regret==1)\n",
      "         z =  1.898\n",
      "Prob > |z| = 0.0577\n",
      "Exact prob = 0.0577\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT==2 & ( TR==0 | TR==2 ) & ~mod_practice\n",
    "\n",
    "qui gen regret = TR == 2\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* T-test *\n",
    "ttest relative_V if t==1, by(regret)\n",
    "\n",
    "* Mann-Whitney *\n",
    "ranksum relative_V if t==1, by(regret)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.2.4 Standard versus Regret-Social (first-round only)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "           |     TT\n",
      "        TR |       Seq |     Total\n",
      "-----------+-----------+----------\n",
      "       Std |     2,400 |     2,400 \n",
      " Re-Social |       900 |       900 \n",
      "-----------+-----------+----------\n",
      "     Total |     3,300 |     3,300 \n"
     ]
    }
   ],
   "source": [
    "tab TR TT if TT==2 & ( TR==0 | TR==3 ) & ~mod_practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "       0 |      80    .9231959    .0372744    .3333923    .8490031    .9973887\n",
      "       1 |      30    .7697595    .0561465    .3075269     .654927    .8845919\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     110    .8813496    .0316849     .332314    .8185512     .944148\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .1534364    .0699312                .0148207    .2920522\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(0) - mean(1)                                      t =   2.1941\n",
      "H0: diff = 0                                     Degrees of freedom =      108\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.9848         Pr(|T| > |t|) = 0.0304          Pr(T > t) = 0.0152\n",
      "\n",
      "\n",
      "Two-sample Wilcoxon rank-sum (Mann–Whitney) test\n",
      "\n",
      "      regret |      Obs    Rank sum    Expected\n",
      "-------------+---------------------------------\n",
      "           0 |       80      4722.5        4440\n",
      "           1 |       30      1382.5        1665\n",
      "-------------+---------------------------------\n",
      "    Combined |      110        6105        6105\n",
      "\n",
      "Unadjusted variance    22200.00\n",
      "Adjustment for ties      -72.36\n",
      "                     ----------\n",
      "Adjusted variance      22127.64\n",
      "\n",
      "H0: relati~V(regret==0) = relati~V(regret==1)\n",
      "         z =  1.899\n",
      "Prob > |z| = 0.0575\n",
      "Exact prob = 0.0575\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT==2 & ( TR==0 | TR==3 ) & ~mod_practice\n",
    "\n",
    "qui gen regret = TR == 3\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* T-test *\n",
    "ttest relative_V if t==1, by(regret)\n",
    "\n",
    "* Mann-Whitney *\n",
    "ranksum relative_V if t==1, by(regret)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.3 Sequentiality Premium using alternative regret implementations (all rounds)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.3.1. Regret-Choice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |        Re  Re-Choice |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |     2,400          0 |     2,400 \n",
      "              Seq |         0        900 |       900 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400        900 |     3,300 \n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui drop if TT==2 & TR==1\n",
    "\n",
    "tab TT TR if ( TR==1 | TR==2 ) & ~mod_practice\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |        Re  Re-Choice |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |     2,400          0 |     2,400 \n",
      "              Seq |         0        900 |       900 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400        900 |     3,300 \n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(1, 109)         =       4.34\n",
      "                                                Prob > F          =     0.0396\n",
      "                                                R-squared         =     0.0283\n",
      "                                                Root MSE          =     .40257\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1542222   .0740335     2.08   0.040     .0074903    .3009541\n",
      "       _cons |   .6451547   .0433676    14.88   0.000     .5592014    .7311079\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(2, 109)         =       5.66\n",
      "                                                Prob > F          =     0.0046\n",
      "                                                R-squared         =     0.0708\n",
      "                                                Root MSE          =     .39373\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1291935   .0743629     1.74   0.085    -.0181913    .2765783\n",
      "      female |  -.1716255   .0733463    -2.34   0.021    -.3169955   -.0262556\n",
      "       _cons |   .7502753   .0673684    11.14   0.000     .6167533    .8837973\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if ( TR==1 | TR==2 ) & ~mod_practice\n",
    "qui drop if TT==2 & TR==1\n",
    "\n",
    "tab TT TR\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.3.2 Regret-Random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |        Re     Re-Rnd |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |     2,400          0 |     2,400 \n",
      "              Seq |         0      1,380 |     1,380 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400      1,380 |     3,780 \n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui drop if TT==2 & TR==1\n",
    "\n",
    "tab TT TR if ( TR==1 | TR==4 ) & ~mod_practice\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |        Re     Re-Rnd |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |     2,400          0 |     2,400 \n",
      "              Seq |         0      1,380 |     1,380 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400      1,380 |     3,780 \n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,780\n",
      "                                                F(1, 125)         =      15.50\n",
      "                                                Prob > F          =     0.0001\n",
      "                                                R-squared         =     0.0972\n",
      "                                                Root MSE          =      .3979\n",
      "\n",
      "                                    (Std. err. adjusted for 126 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2711759   .0688894     3.94   0.000     .1348353    .4075164\n",
      "       _cons |   .6451547   .0433415    14.89   0.000     .5593764     .730933\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,780\n",
      "                                                F(2, 125)         =       8.56\n",
      "                                                Prob > F          =     0.0003\n",
      "                                                R-squared         =     0.1082\n",
      "                                                Root MSE          =     .39552\n",
      "\n",
      "                                    (Std. err. adjusted for 126 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2829978   .0696084     4.07   0.000     .1452342    .4207613\n",
      "      female |  -.0933575   .0763504    -1.22   0.224    -.2444643    .0577493\n",
      "       _cons |   .7023361   .0686411    10.23   0.000     .5664869    .8381853\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if ( TR==1 | TR==4 ) & ~mod_practice\n",
    "qui drop if TT==2 & TR==1\n",
    "\n",
    "tab TT TR\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.3.3 Regret-Social"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |        Re  Re-Social |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |     2,400          0 |     2,400 \n",
      "              Seq |         0        900 |       900 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400        900 |     3,300 \n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui drop if TT==2 & TR==1\n",
    "\n",
    "tab TT TR if ( TR==1 | TR==3 ) & ~mod_practice\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |        Re  Re-Social |     Total\n",
      "------------------+----------------------+----------\n",
      "    One-shot (30) |     2,400          0 |     2,400 \n",
      "              Seq |         0        900 |       900 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400        900 |     3,300 \n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(1, 109)         =       0.65\n",
      "                                                Prob > F          =     0.4226\n",
      "                                                R-squared         =     0.0036\n",
      "                                                Root MSE          =     .36555\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .0495899   .0616101     0.80   0.423    -.0725194    .1716992\n",
      "       _cons |   .6451547   .0433676    14.88   0.000     .5592014    .7311079\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(2, 109)         =       2.73\n",
      "                                                Prob > F          =     0.0695\n",
      "                                                R-squared         =     0.0415\n",
      "                                                Root MSE          =     .35859\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .0477644    .061559     0.78   0.439    -.0742436    .1697725\n",
      "      female |   -.146038   .0707394    -2.06   0.041    -.2862412   -.0058348\n",
      "       _cons |    .734603   .0664289    11.06   0.000     .6029431    .8662628\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if ( TR==1 | TR==3 ) & ~mod_practice\n",
    "qui drop if TT==2 & TR==1\n",
    "\n",
    "tab TT TR\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.4 Standard versus Regret-Random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "                  |          TR\n",
      "               TT |       Std     Re-Rnd |     Total\n",
      "------------------+----------------------+----------\n",
      "              Seq |     2,400      1,380 |     3,780 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400      1,380 |     3,780 \n"
     ]
    }
   ],
   "source": [
    "tab TT TR if TT==2 & ( TR==0 | TR==4 ) & ~mod_practice"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "                  |          TR\n",
      "               TT |       Std     Re-Rnd |     Total\n",
      "------------------+----------------------+----------\n",
      "              Seq |     2,400      1,380 |     3,780 \n",
      "------------------+----------------------+----------\n",
      "            Total |     2,400      1,380 |     3,780 \n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        126\n",
      "                                                F(1, 124)         =       0.04\n",
      "                                                Prob > F          =     0.8430\n",
      "                                                R-squared         =     0.0003\n",
      "                                                Root MSE          =     .35827\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0137831   .0694308     0.20   0.843    -.1236399     .151206\n",
      "       _cons |   .9231959   .0373382    24.73   0.000     .8492931    .9970987\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        126\n",
      "                                                F(2, 123)         =       0.08\n",
      "                                                Prob > F          =     0.9248\n",
      "                                                R-squared         =     0.0013\n",
      "                                                Root MSE          =     .35956\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0114394   .0702622     0.16   0.871    -.1276402    .1505191\n",
      "      female |   .0230602   .0693371     0.33   0.740    -.1141883    .1603088\n",
      "       _cons |    .908495   .0577564    15.73   0.000     .7941698     1.02282\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,780\n",
      "                                                F(1, 125)         =       0.32\n",
      "                                                Prob > F          =     0.5709\n",
      "                                                R-squared         =     0.0020\n",
      "                                                Root MSE          =     .38622\n",
      "\n",
      "                                    (Std. err. adjusted for 126 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0358322   .0630577     0.57   0.571    -.0889668    .1606312\n",
      "       _cons |   .8804983    .033302    26.44   0.000     .8145896     .946407\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,780\n",
      "                                                F(2, 125)         =       0.64\n",
      "                                                Prob > F          =     0.5307\n",
      "                                                R-squared         =     0.0083\n",
      "                                                Root MSE          =     .38506\n",
      "\n",
      "                                    (Std. err. adjusted for 126 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0425029   .0647468     0.66   0.513    -.0856391     .170645\n",
      "      female |  -.0656369   .0617918    -1.06   0.290    -.1879306    .0566569\n",
      "       _cons |   .9223418   .0474807    19.43   0.000     .8283715    1.016312\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT==2 & ( TR==0 | TR==4 ) & ~mod_practice\n",
    "\n",
    "tab TT TR\n",
    "\n",
    "gen regret = TR == 4\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1, r\n",
    "reg relative_V regret female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret, cluster(i)\n",
    "reg relative_V regret female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (7) Sequential treatments with modified practice stage"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: this section contains the tests of difference mention in the text on subsection 3.3.2. Later in the code we reproduce the full results as in Appendix Table D.3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "7.1 TTEST on difference in valuations for Standard lotteries in the first round"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "       0 |      80    .9231959    .0372744    .3333923    .8490031    .9973887\n",
      "       1 |      30     .739244    .0736255    .4032637    .5886629    .8898251\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     110    .8730272    .0344566    .3613837    .8047354     .941319\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .1839519    .0756826                .0339359    .3339679\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(0) - mean(1)                                      t =   2.4306\n",
      "H0: diff = 0                                     Degrees of freedom =      108\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.9916         Pr(|T| > |t|) = 0.0167          Pr(T > t) = 0.0084\n"
     ]
    }
   ],
   "source": [
    "ttest relative_V if TT==2 & TR==0 & t==1, by(mod_practice)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "7.2 TTEST on difference in valuations for Regret lotteries in the first round"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Two-sample t test with equal variances\n",
      "------------------------------------------------------------------------------\n",
      "   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]\n",
      "---------+--------------------------------------------------------------------\n",
      "       0 |      80    .8135052      .03779    .3380036    .7382862    .8887242\n",
      "       1 |      30    .6735395    .0740859    .4057851    .5220169    .8250622\n",
      "---------+--------------------------------------------------------------------\n",
      "Combined |     110    .7753327     .034448    .3612933     .707058    .8436075\n",
      "---------+--------------------------------------------------------------------\n",
      "    diff |            .1399656    .0765295                -.011729    .2916603\n",
      "------------------------------------------------------------------------------\n",
      "    diff = mean(0) - mean(1)                                      t =   1.8289\n",
      "H0: diff = 0                                     Degrees of freedom =      108\n",
      "\n",
      "    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0\n",
      " Pr(T < t) = 0.9649         Pr(|T| > |t|) = 0.0702          Pr(T > t) = 0.0351\n"
     ]
    }
   ],
   "source": [
    "ttest relative_V if TT==2 & TR==1 & t==1, by(mod_practice)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "7.3 TTEST on difference in valuations for Standard lotteries in all rounds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(1, 109)         =       0.54\n",
      "                                                Prob > F          =     0.4646\n",
      "                                                R-squared         =     0.0035\n",
      "                                                Root MSE          =     .38192\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "mod_practice |  -.0511191   .0696501    -0.73   0.465    -.1891634    .0869252\n",
      "       _cons |   .8804983    .033322    26.42   0.000     .8144552    .9465414\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  mod_practice + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8293792    .061162    13.56   0.000     .7081581    .9506002\n",
      "------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "reg relative_V mod_practice if TT==2 & TR==0, cluster(i)\n",
    "\n",
    "lincom _cons + _b[mod_practice]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "7.4 TTEST on difference in valuations for Regret lotteries in all rounds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(1, 109)         =       0.17\n",
      "                                                Prob > F          =     0.6768\n",
      "                                                R-squared         =     0.0010\n",
      "                                                Root MSE          =     .40654\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "mod_practice |   -.029126   .0696782    -0.42   0.677    -.1672259    .1089738\n",
      "       _cons |   .8354124   .0313851    26.62   0.000     .7732081    .8976167\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  mod_practice + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8062864   .0622095    12.96   0.000     .6829892    .9295836\n",
      "------------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "reg relative_V mod_practice if TT==2 & TR==1, cluster(i)\n",
    "\n",
    "lincom _cons + _b[mod_practice]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (8) Online Appendix TABLE D.1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Regression-based tests of the main hypotheses for FIRST-WAVE of lab experiments"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "8.1 Hypothesis 1: Static Regret Effect "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(1, 98)          =       0.44\n",
      "                                                Prob > F          =     0.5066\n",
      "                                                R-squared         =     0.0045\n",
      "                                                Root MSE          =     .38228\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0509691   .0764563     0.67   0.507    -.1007559     .202694\n",
      "       _cons |   .5641237   .0499897    11.28   0.000     .4649208    .6633267\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .6150928   .0578497    10.63   0.000     .5002919    .7298937\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(2, 97)          =       5.05\n",
      "                                                Prob > F          =     0.0082\n",
      "                                                R-squared         =     0.1109\n",
      "                                                Root MSE          =     .36313\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0612897   .0731545     0.84   0.404    -.0839018    .2064812\n",
      "      female |  -.2580152   .0814317    -3.17   0.002    -.4196345   -.0963959\n",
      "       _cons |   .7240932   .0715372    10.12   0.000     .5821117    .8660747\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(1, 99)          =       0.45\n",
      "                                                Prob > F          =     0.5045\n",
      "                                                R-squared         =     0.0045\n",
      "                                                Root MSE          =     .37857\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0509691   .0760818     0.67   0.504    -.0999938    .2019319\n",
      "       _cons |   .5641237   .0497449    11.34   0.000     .4654191    .6628284\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .6150928   .0575664    10.68   0.000     .5008686     .729317\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(2, 99)          =       5.15\n",
      "                                                Prob > F          =     0.0074\n",
      "                                                R-squared         =     0.1109\n",
      "                                                Root MSE          =     .35782\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0612897    .072436     0.85   0.400     -.082439    .2050184\n",
      "      female |  -.2580152   .0806318    -3.20   0.002    -.4180062   -.0980242\n",
      "       _cons |   .7240932   .0708345    10.22   0.000     .5835421    .8646442\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT == 1 & wave == 1\n",
    "qui gen regret = TR == 1\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1, r\n",
    "lincom _cons + _b[regret]\n",
    "\n",
    "reg relative_V regret female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret, cluster(i)\n",
    "lincom _cons + _b[regret]\n",
    "\n",
    "reg relative_V regret female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "8.2 Hypothesis 2: Sequentiality Effect on Standard Lotteries "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(1, 98)          =      35.64\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.2667\n",
      "                                                Root MSE          =     .32671\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .3901031   .0653414     5.97   0.000     .2604352    .5197711\n",
      "       _cons |   .5641237   .0499897    11.28   0.000     .4649208    .6633267\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .9542268   .0420777    22.68   0.000      .870725    1.037729\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(2, 97)          =      23.50\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.3067\n",
      "                                                Root MSE          =      .3193\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .3996288   .0635053     6.29   0.000     .2735883    .5256693\n",
      "      female |  -.1587611   .0672137    -2.36   0.020    -.2921616   -.0253605\n",
      "       _cons |   .6625556   .0661605    10.01   0.000     .5312453    .7938659\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(1, 99)          =      27.83\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.1832\n",
      "                                                Root MSE          =     .33797\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |    .320055   .0606712     5.28   0.000     .1996702    .4404398\n",
      "       _cons |   .5641237   .0497449    11.34   0.000     .4654191    .6628284\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8841787   .0347338    25.46   0.000     .8152593    .9530981\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(2, 99)          =      21.99\n",
      "                                                Prob > F          =     0.0000\n",
      "                                                R-squared         =     0.2348\n",
      "                                                Root MSE          =     .32719\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |    .330751   .0578308     5.72   0.000     .2160021    .4454999\n",
      "      female |  -.1782671   .0614273    -2.90   0.005    -.3001521   -.0563821\n",
      "       _cons |   .6746493   .0633585    10.65   0.000     .5489322    .8003664\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 0 & mod_practice == 0 & wave == 1\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "8.3 Hypothesis 3: Sequentiality Effect on Regret Lotteries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(1, 98)          =       7.67\n",
      "                                                Prob > F          =     0.0067\n",
      "                                                R-squared         =     0.0726\n",
      "                                                Root MSE          =     .35045\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1941443   .0700906     2.77   0.007     .0550518    .3332369\n",
      "       _cons |   .6150928   .0578497    10.63   0.000     .5002919    .7298937\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8092371    .039574    20.45   0.000     .7307037    .8877705\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(2, 97)          =       7.21\n",
      "                                                Prob > F          =     0.0012\n",
      "                                                R-squared         =     0.1124\n",
      "                                                Root MSE          =     .34462\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1851992   .0699788     2.65   0.009     .0463106    .3240878\n",
      "      female |  -.1490858   .0767709    -1.94   0.055    -.3014549    .0032832\n",
      "       _cons |   .7134895   .0848281     8.41   0.000     .5451291    .8818498\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(1, 99)          =       7.62\n",
      "                                                Prob > F          =     0.0069\n",
      "                                                R-squared         =     0.0586\n",
      "                                                Root MSE          =     .38017\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1896797   .0686925     2.76   0.007      .053379    .3259805\n",
      "       _cons |   .6150928   .0575664    10.68   0.000     .5008686     .729317\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8047725   .0374802    21.47   0.000     .7304037    .8791414\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(2, 99)          =       9.82\n",
      "                                                Prob > F          =     0.0001\n",
      "                                                R-squared         =     0.1116\n",
      "                                                Root MSE          =     .36938\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1784544   .0675133     2.64   0.010     .0444934    .3124154\n",
      "      female |  -.1870884   .0732935    -2.55   0.012    -.3325186   -.0416581\n",
      "       _cons |   .7385711   .0825435     8.95   0.000     .5747869    .9023554\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 1 & mod_practice==0 & wave == 1\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "8.4 Hypothesis 4: Anticipated Learning Hypothesis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(1, 98)          =       6.30\n",
      "                                                Prob > F          =     0.0137\n",
      "                                                R-squared         =     0.0604\n",
      "                                                Root MSE          =     .28882\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.1449897   .0577636    -2.51   0.014    -.2596198   -.0303596\n",
      "       _cons |   .9542268   .0420777    22.68   0.000      .870725    1.037729\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        100\n",
      "                                                F(2, 97)          =       3.71\n",
      "                                                Prob > F          =     0.0281\n",
      "                                                R-squared         =     0.0668\n",
      "                                                Root MSE          =     .28932\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.1489231   .0576222    -2.58   0.011    -.2632872    -.034559\n",
      "      female |  -.0491673   .0591161    -0.83   0.408    -.1664965    .0681618\n",
      "       _cons |   .9876606   .0553752    17.84   0.000     .8777561    1.097565\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(1, 99)          =       2.41\n",
      "                                                Prob > F          =     0.1234\n",
      "                                                R-squared         =     0.0135\n",
      "                                                Root MSE          =     .33977\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0794062   .0510999    -1.55   0.123    -.1807995    .0219871\n",
      "       _cons |   .8841787   .0347338    25.46   0.000     .8152593    .9530981\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,000\n",
      "                                                F(2, 99)          =       3.67\n",
      "                                                Prob > F          =     0.0290\n",
      "                                                R-squared         =     0.0359\n",
      "                                                Root MSE          =     .33594\n",
      "\n",
      "                                    (Std. err. adjusted for 100 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0879704   .0500777    -1.76   0.082    -.1873355    .0113946\n",
      "      female |  -.1070531   .0500685    -2.14   0.035    -.2063999   -.0077063\n",
      "       _cons |   .9569748   .0448388    21.34   0.000     .8680049    1.045945\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret = .06\n",
      "\n",
      "       F(  1,    99) =    8.73\n",
      "            Prob > F =    0.0039\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR <= 1 & mod_practice==0 & wave == 1\n",
    "\n",
    "qui gen regret = TR == 1\n",
    "qui gen sequential = TT == 2\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1 & TT==2, r\n",
    "reg relative_V regret female if t==1 & TT==2, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret if TT==2, cluster(i)\n",
    "reg relative_V regret female if TT==2, cluster(i)\n",
    "\n",
    "* One-sample ttest on the equality of the sequential and static regret effects\n",
    "test _b[regret] == 0.06\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (9) Online Appendix TABLE D.2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "9.1 Hypothesis 1: Static Regret Effect "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(1, 58)          =       0.71\n",
      "                                                Prob > F          =     0.4045\n",
      "                                                R-squared         =     0.0120\n",
      "                                                Root MSE          =     .35122\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0761512   .0906838     0.84   0.404    -.1053721    .2576745\n",
      "       _cons |   .6191065   .0638817     9.69   0.000     .4912334    .7469797\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .6952578   .0643636    10.80   0.000       .56642    .8240955\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(2, 57)          =       0.74\n",
      "                                                Prob > F          =     0.4805\n",
      "                                                R-squared         =     0.0223\n",
      "                                                Root MSE          =     .35244\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0784987   .0906578     0.87   0.390    -.1030405    .2600379\n",
      "      female |  -.0704245   .0913828    -0.77   0.444    -.2534153    .1125663\n",
      "       _cons |   .6543188   .0873277     7.49   0.000     .4794481    .8291896\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(1, 59)          =       0.72\n",
      "                                                Prob > F          =     0.4006\n",
      "                                                R-squared         =     0.0120\n",
      "                                                Root MSE          =     .34551\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0761512    .089937     0.85   0.401    -.1038123    .2561147\n",
      "       _cons |   .6191065   .0633557     9.77   0.000     .4923322    .7458809\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .6952578   .0638336    10.89   0.000     .5675271    .8229884\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(2, 59)          =       0.77\n",
      "                                                Prob > F          =     0.4686\n",
      "                                                R-squared         =     0.0223\n",
      "                                                Root MSE          =      .3438\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0784987   .0891576     0.88   0.382    -.0999052    .2569026\n",
      "      female |  -.0704245   .0898705    -0.78   0.436     -.250255    .1094059\n",
      "       _cons |   .6543188   .0858826     7.62   0.000     .4824682    .8261695\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TT == 1 & wave == 2\n",
    "qui gen regret = TR == 1\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1, r\n",
    "lincom _cons + _b[regret]\n",
    "\n",
    "reg relative_V regret female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret, cluster(i)\n",
    "lincom _cons + _b[regret]\n",
    "\n",
    "reg relative_V regret female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "9.2 Hypothesis 2: Sequentiality Effect on Standard Lotteries "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(1, 58)          =       7.05\n",
      "                                                Prob > F          =     0.0102\n",
      "                                                R-squared         =     0.1083\n",
      "                                                Root MSE          =     .36824\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2523711   .0950804     2.65   0.010      .062047    .4426953\n",
      "       _cons |   .6191065   .0638817     9.69   0.000     .4912334    .7469797\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8714777   .0704231    12.37   0.000     .7305105    1.012445\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(2, 57)          =       4.00\n",
      "                                                Prob > F          =     0.0237\n",
      "                                                R-squared         =     0.1141\n",
      "                                                Root MSE          =     .37026\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2562668   .0948581     2.70   0.009     .0663167    .4462168\n",
      "      female |  -.0584347   .0961214    -0.61   0.546    -.2509145    .1340452\n",
      "       _cons |   .6483239   .0886802     7.31   0.000     .4707448    .8259029\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(1, 59)          =       7.58\n",
      "                                                Prob > F          =     0.0078\n",
      "                                                R-squared         =     0.0977\n",
      "                                                Root MSE          =     .38808\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2552577   .0927141     2.75   0.008     .0697372    .4407783\n",
      "       _cons |   .6191065   .0633557     9.77   0.000     .4923322    .7458809\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8743643   .0676903    12.92   0.000     .7389163    1.009812\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(2, 59)          =       8.01\n",
      "                                                Prob > F          =     0.0008\n",
      "                                                R-squared         =     0.1350\n",
      "                                                Root MSE          =     .38008\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2658185   .0887023     3.00   0.004     .0883256    .4433114\n",
      "      female |  -.1584115   .0890734    -1.78   0.080     -.336647    .0198239\n",
      "       _cons |   .6983123   .0859123     8.13   0.000     .5264023    .8702224\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 0 & mod_practice == 0 & wave == 2\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "9.3 Hypothesis 3: Sequentiality Effect on Regret Lotteries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(1, 58)          =       1.56\n",
      "                                                Prob > F          =     0.2174\n",
      "                                                R-squared         =     0.0261\n",
      "                                                Root MSE          =      .3893\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1253608   .1005171     1.25   0.217     -.075846    .3265677\n",
      "       _cons |   .6952578   .0643636    10.80   0.000       .56642    .8240955\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8206186   .0772076    10.63   0.000     .6660708    .9751664\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(2, 57)          =       0.97\n",
      "                                                Prob > F          =     0.3863\n",
      "                                                R-squared         =     0.0364\n",
      "                                                Root MSE          =     .39062\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1201031   .1001682     1.20   0.235    -.0804803    .3206865\n",
      "      female |   -.078866   .1001682    -0.79   0.434    -.2794494    .1217174\n",
      "       _cons |   .7373196   .0864417     8.53   0.000     .5642232     .910416\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(1, 59)          =       5.18\n",
      "                                                Prob > F          =     0.0265\n",
      "                                                R-squared         =     0.0591\n",
      "                                                Root MSE          =     .38177\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1912211   .0840484     2.28   0.027     .0230406    .3594015\n",
      "       _cons |   .6952578   .0638336    10.89   0.000     .5675271    .8229884\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  sequential + _cons = 0\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "  relative_V | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "         (1) |   .8864788   .0546755    16.21   0.000     .7770734    .9958842\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(2, 59)          =       2.78\n",
      "                                                Prob > F          =     0.0699\n",
      "                                                R-squared         =     0.0650\n",
      "                                                Root MSE          =     .38066\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1871649   .0835463     2.24   0.029     .0199893    .3543406\n",
      "      female |  -.0608419   .0835463    -0.73   0.469    -.2280176    .1063337\n",
      "       _cons |   .7277068   .0802752     9.07   0.000     .5670764    .8883372\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 1 & mod_practice==0 & wave == 2\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "lincom _cons + _b[sequential]\n",
    "\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "9.4 Hypothesis 4: Anticipated Learning Hypothesis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(1, 58)          =       0.24\n",
      "                                                Prob > F          =     0.6283\n",
      "                                                R-squared         =     0.0041\n",
      "                                                Root MSE          =     .40473\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0508591   .1045008    -0.49   0.628    -.2600403     .158322\n",
      "       _cons |   .8714777   .0704231    12.37   0.000     .7305105    1.012445\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(2, 57)          =       0.38\n",
      "                                                Prob > F          =     0.6874\n",
      "                                                R-squared         =     0.0110\n",
      "                                                Root MSE          =     .40684\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0575497   .1039684    -0.55   0.582    -.2657429    .1506435\n",
      "      female |  -.0669061   .1046551    -0.64   0.525    -.2764742    .1426621\n",
      "       _cons |   .9093911    .093219     9.76   0.000     .7227232    1.096059\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(1, 59)          =       0.02\n",
      "                                                Prob > F          =     0.8897\n",
      "                                                R-squared         =     0.0002\n",
      "                                                Root MSE          =     .42069\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |   .0121146   .0870137     0.14   0.890    -.1619995    .1862286\n",
      "       _cons |   .8743643   .0676903    12.92   0.000     .7389163    1.009812\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(2, 59)          =       1.69\n",
      "                                                Prob > F          =     0.1932\n",
      "                                                R-squared         =     0.0312\n",
      "                                                Root MSE          =     .41422\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0027817   .0829305    -0.03   0.973    -.1687251    .1631618\n",
      "      female |  -.1489621   .0827754    -1.80   0.077    -.3145952    .0166711\n",
      "       _cons |   .9587761   .0712865    13.45   0.000     .8161321     1.10142\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      " ( 1)  regret = .06\n",
      "\n",
      "       F(  1,    59) =    0.57\n",
      "            Prob > F =    0.4520\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR <= 1 & mod_practice==0 & wave == 2\n",
    "\n",
    "qui gen regret = TR == 1\n",
    "qui gen sequential = TT == 2\n",
    "qui gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1 & TT==2, r\n",
    "reg relative_V regret female if t==1 & TT==2, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret if TT==2, cluster(i)\n",
    "reg relative_V regret female if TT==2, cluster(i)\n",
    "\n",
    "* One-sample ttest on the equality of the sequential and static regret effects\n",
    "test _b[regret] == 0.06\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## (10) Online Appendix TABLE D.3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "10.1 Hypothesis 1: Static Regret Effect (SAME AS BEFORE)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "10.2 Hypothesis 2: Sequentiality Effect on Standard Lotteries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        110\n",
      "                                                F(1, 108)         =       3.47\n",
      "                                                Prob > F          =     0.0653\n",
      "                                                R-squared         =     0.0348\n",
      "                                                Root MSE          =     .36573\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1545017   .0829787     1.86   0.065    -.0099764    .3189798\n",
      "       _cons |   .5847423   .0393496    14.86   0.000     .5067446      .66274\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        110\n",
      "                                                F(2, 107)         =       7.80\n",
      "                                                Prob > F          =     0.0007\n",
      "                                                R-squared         =     0.1413\n",
      "                                                Root MSE          =     .34657\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1443828   .0759592     1.90   0.060    -.0061975    .2949631\n",
      "      female |  -.2428538   .0686126    -3.54   0.001    -.3788703   -.1068372\n",
      "       _cons |   .7243832   .0593147    12.21   0.000     .6067986    .8419678\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(1, 109)         =      11.34\n",
      "                                                Prob > F          =     0.0010\n",
      "                                                R-squared         =     0.0801\n",
      "                                                Root MSE          =     .36932\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2446369   .0726322     3.37   0.001     .1006822    .3885916\n",
      "       _cons |   .5847423   .0391746    14.93   0.000     .5070995    .6623851\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(2, 109)         =      10.36\n",
      "                                                Prob > F          =     0.0001\n",
      "                                                R-squared         =     0.1321\n",
      "                                                Root MSE          =      .3588\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .2372604   .0711506     3.33   0.001     .0962421    .3782787\n",
      "      female |  -.1770359   .0659288    -2.69   0.008    -.3077047    -.046367\n",
      "       _cons |   .6865379   .0579104    11.86   0.000     .5717614    .8013144\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 0 \n",
    "qui drop if TT==2 & mod_practice==0\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "10.3 Hypothesis 3: Sequentiality Effect on Regret Lotteries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        110\n",
      "                                                F(1, 108)         =       0.11\n",
      "                                                Prob > F          =     0.7404\n",
      "                                                R-squared         =     0.0011\n",
      "                                                Root MSE          =     .39322\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .0283849   .0854494     0.33   0.740    -.1409907    .1977605\n",
      "       _cons |   .6451547   .0435613    14.81   0.000     .5588085    .7315008\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =        110\n",
      "                                                F(2, 107)         =       4.71\n",
      "                                                Prob > F          =     0.0109\n",
      "                                                R-squared         =     0.0856\n",
      "                                                Root MSE          =     .37797\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |  -.0053213   .0807982    -0.07   0.948    -.1654942    .1548517\n",
      "      female |  -.2311279   .0760494    -3.04   0.003    -.3818869   -.0803689\n",
      "       _cons |   .7867205   .0688901    11.42   0.000      .650154     .923287\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(1, 109)         =       4.51\n",
      "                                                Prob > F          =     0.0359\n",
      "                                                R-squared         =     0.0296\n",
      "                                                Root MSE          =     .41125\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1611317   .0758338     2.12   0.036     .0108315    .3114319\n",
      "       _cons |   .6451547   .0433676    14.88   0.000     .5592014    .7311079\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      3,300\n",
      "                                                F(2, 109)         =       5.68\n",
      "                                                Prob > F          =     0.0045\n",
      "                                                R-squared         =     0.0739\n",
      "                                                Root MSE          =     .40181\n",
      "\n",
      "                                    (Std. err. adjusted for 110 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "  sequential |   .1350105   .0751013     1.80   0.075    -.0138379    .2838589\n",
      "      female |  -.1791169   .0736129    -2.43   0.017    -.3250152   -.0332185\n",
      "       _cons |   .7548637    .067471    11.19   0.000     .6211384     .888589\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR == 1\n",
    "qui drop if TT==2 & mod_practice==0\n",
    "\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V sequential if t==1, r\n",
    "reg relative_V sequential female if t==1, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V sequential, cluster(i)\n",
    "reg relative_V sequential female, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "10.4 Hypothesis 4: Anticipated Learning Hypothesis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(1, 58)          =       0.40\n",
      "                                                Prob > F          =     0.5318\n",
      "                                                R-squared         =     0.0068\n",
      "                                                Root MSE          =     .40453\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0657045   .1044483    -0.63   0.532    -.2747804    .1433714\n",
      "       _cons |    .739244   .0736255    10.04   0.000     .5918665    .8866215\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =         60\n",
      "                                                F(2, 57)          =       7.29\n",
      "                                                Prob > F          =     0.0015\n",
      "                                                R-squared         =     0.2091\n",
      "                                                Root MSE          =     .36414\n",
      "\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0896907   .0947293    -0.95   0.348    -.2793829    .1000015\n",
      "      female |  -.3597938   .0947293    -3.80   0.000     -.549486   -.1701016\n",
      "       _cons |    .931134   .0923615    10.08   0.000     .7461833    1.116085\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(1, 59)          =       0.07\n",
      "                                                Prob > F          =     0.7930\n",
      "                                                R-squared         =     0.0007\n",
      "                                                Root MSE          =     .44622\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0230928   .0875864    -0.26   0.793    -.1983528    .1521672\n",
      "       _cons |   .8293792   .0614049    13.51   0.000     .7065083    .9522501\n",
      "------------------------------------------------------------------------------\n",
      "\n",
      "\n",
      "Linear regression                               Number of obs     =      1,800\n",
      "                                                F(2, 59)          =       1.58\n",
      "                                                Prob > F          =     0.2139\n",
      "                                                R-squared         =     0.0283\n",
      "                                                Root MSE          =     .44014\n",
      "\n",
      "                                     (Std. err. adjusted for 60 clusters in i)\n",
      "------------------------------------------------------------------------------\n",
      "             |               Robust\n",
      "  relative_V | Coefficient  std. err.      t    P>|t|     [95% conf. interval]\n",
      "-------------+----------------------------------------------------------------\n",
      "      regret |  -.0329983   .0853307    -0.39   0.700    -.2037446     .137748\n",
      "      female |  -.1485825   .0853307    -1.74   0.087    -.3193288    .0221638\n",
      "       _cons |   .9086232   .0762111    11.92   0.000     .7561251    1.061121\n",
      "------------------------------------------------------------------------------\n",
      "\n"
     ]
    }
   ],
   "source": [
    "preserve\n",
    "\n",
    "qui keep if TR <= 1\n",
    "qui drop if TT==2 & mod_practice==0\n",
    "\n",
    "gen regret = TR == 1\n",
    "gen sequential = TT == 2\n",
    "gen female = IsFemale\n",
    "\n",
    "* First-round only\n",
    "\n",
    "reg relative_V regret if t==1 & TT==2, r\n",
    "reg relative_V regret female if t==1 & TT==2, r\n",
    "\n",
    "* All rounds with clustering\n",
    "\n",
    "reg relative_V regret if TT==2, cluster(i)\n",
    "reg relative_V regret female if TT==2, cluster(i)\n",
    "\n",
    "restore"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# THE END"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "NOTE: Online Appendix Table D.5 and D.6 use data from our online experiments and is available on a separate notebook"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Stata",
   "language": "stata",
   "name": "stata"
  },
  "language_info": {
   "codemirror_mode": "stata",
   "file_extension": ".do",
   "mimetype": "text/x-stata",
   "name": "stata",
   "version": "15.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
